Download presentation
Presentation is loading. Please wait.
1
Sensors 101 Caitlyn Byrne – FRC 3941
2
Sensors, Intelligence, ROBOT!
Why Sensors? Robot: “A robot is a machine—especially one programmable by a computer— capable of carrying out a complex series of actions automatically.” (Source: Wikipedia) Not a Robot We tend to be ‘overly broad’ in society when we mention robots. Most have no awareness of their environment, even if they are capable of running a scripted set of actions by themselves. I would suggest that scripted actions have minimal value in FRC, so lets look to enable some intelligence in our robots, using Sensors. Sensors give the robot a sense of the world state, and allow them to decide what to do and when to do it. Sensors, Intelligence, ROBOT! Sensors MRA EdDay 2017 10/28/2017
3
Why Sensors? Sensors enable your FRC robot to do fabulous things automagically! Sensors can assist the robot with Simple tasks: Detect when the GEAR has been placed on a PEG Detect when the GEAR is clear of the robot Maintain a RPM on a shooter Sensors can also assist the robot with Complex tasks: Drive in a straight line Drive up to a PEG to place a GEAR Automatically move game elements in the robot to their places Sensors MRA EdDay 2017 10/28/2017
4
What sensors are out there?
Near limitless variety of ‘sensors’: Robotshop.com lists 1168 different ‘robot sensor’ products; Sparkfun.com lists 232 products; Pololu.com lists 113 products Granted, some of the above are duplicated across multiple sites Anything that allows the robot to measure and act on its environment can be used as a sensor – e.g., touch, vision, pressure, speed Sensors MRA EdDay 2017 10/28/2017
5
Sensor Types (useful to FRC)
Touch (Limit switches, safety bumpers, Presence (Beam splitters or non-contact IR proximity) “1 dimensional” distance (just range) “2 dimensional” distance (angle + range) “3 dimensional” distance (x + y + range) (Smart) Cameras Rotation / Angle measurement Orientation (Position, Velocity, Acceleration) Sensor Fusion: Where is my robot? Just a small subset of the overall sensor space. For instance, that sensor for detecting water levels in dirt? Good for your plants, but not good for FRC until we get a water game. ;) Sensors MRA EdDay 2017 10/28/2017
6
Touch The venerable microswitch has been providing touch to robots for decades Simple mechanisms, reliable (as long as you don’t destroy them…), easy to understand, and cheap! Come in many styles Do Don’t Look for tabs (like shown) Primarily stock rollers and long bars Add stiff zipties to bars to make them longer if needed Buy with pins (unless you are spinning a custom circuit board) Buy the really tiny ones (less likely to stand up to robot abuse) Search any relevant site for ‘microswitch’ or ‘micro switch’ to find a ton of these things! (From now on, ‘relevant site’ means: Amazon, RobotShop, Pololu, Sparkfun, Adafruit, Microcenter, etc.) Remember to ‘debounce’ your switches!!! Sensors MRA EdDay 2017 10/28/2017
7
Where does Touch Play? “Hard” Limit switches for motion Simple sensing
E.g., top or bottom of a lift mechanism E.g., minimum / maximum rotation of an arm Simple sensing E.g., flap / door / actuator open or closed E.g., game element is in contact Fancy driver station controls Emergency stop for bumper contact (usually only outside of FRC) Sensors MRA EdDay 2017 10/28/2017
8
A special note on Mechanical Switches
Take a drum stick, and try to press and hold it on a drum – its very had to do without the drum stick bouncing a few times! Mechanical switches exhibit the same characteristic when they are opened or closed! Humans are too slow to see this, but computers (and RoboRios) are fast enough to read each ‘bounce’ of the contacts Therefore, make sure your coding team ‘does the smart thing’ when dealing with bounce Act on Limit switches at the first state change Other switches likely get debounced Sensors MRA EdDay 2017 10/28/2017
9
Presence “Presence” sensors say “Here” or “Not Here” for something in front of them Think of a touch sensor, but at a non-contact distance Do Don’t Get the “Gravity Adjustable IR switch” shown right (~$8.5) Super easy to mount (Drill a single hole!), and reasonably robust Buy a pinned / PCB mounted sensor (unless you enjoy mounting challenges) Go fancy with capacitive, ferrous, or other sensors, unless you enjoy the challenge Sensors MRA EdDay 2017 10/28/2017
10
Where does Presence Play?
“Soft” Limit switches for motion E.g., slow down, you are about to hit the hard limit Simple sensing E.g., Boulder loaded in mechanism Sensors MRA EdDay 2017 10/28/2017
11
A special note on IR The “Gravity” sensor on the previous page, and a lot of distance sensors, use (near) Infrared light to function Near IR = essentially, light that you cannot see with your eye, but not the infrared that thermal cameras use Luckily for us, most FRC materials treat visible light and near infrared the same If you can see it, most likely your robot’s IR sensor can too Sensors MRA EdDay 2017 10/28/2017
12
A special note on IR (cont)
However, sensors using light are ‘trickable’ by the environment Applies to Distance sensors too! Rough Surfaces (e.g., paper, carpet, wood) Mirrored Surfaces (e.g., mirrored aluminum plate, new polycarbonate) Reflect light in all directions High probability that the sensor (presence or distance) will see the object Reflect light incident to the surface High probability that the sensor (presence or distance) will NOT see the object, unless the robot is directly facing the mirrored surface High probability that the sensor will give a false reading of an object it sees in the incident reflection! Images from: Sensors MRA EdDay 2017 10/28/2017
13
“1D” Distance Sensors Distance sensors tell you how far something is in front of the sensor face (without touching it of course!) Many types exist! Laser, LED, and Ultrasonic are common 1D is not an industry standard term, just how I am referring to something that only provides distance data in this presentation Do Don’t Balance Cost vs Capability Look at difficulty to connect to Rio and program (some sensors have built in WPILib libraries!) Make sure there are no obstructions in front of your sensor that will cause a false reading Go straight to the most expensive types without understanding why you are selecting them Assume that any sensor will work in the FRC field – remember what was said before about IR light and angles! Sensors MRA EdDay 2017 10/28/2017
14
Field of View (FOV) Laser based 1D sensors have a ‘narrow’ FOV
LED based 1D sensors have a ‘medium’ FOV Ultrasonic based 1D sensors have a ‘wide’ FOV The first rule of sensors is that generalizations like this one don’t really work in the real world! Read your sensor’s data sheet to figure out what the real Field of View is. Remember that FOV can be specified for both vertical and horizontal directions, so the way you mount the sensor matters as well! Sensors MRA EdDay 2017 10/28/2017
15
Multiple Objects Object Robot 1 Sensor FOV 2 Reported Distance
Most distance sensors will only tell you of the closest object they “see” However, some advanced sensors may allow you to measure multiple objects in their FOV Sensors MRA EdDay 2017 10/28/2017
16
Ultrasonic Notes Remember our special note about IR sensors and reflectivity? Yep! Similar caveats apply to Ultrasonic sensors as well! Hard Rough Surfaces (e.g., paper, carpet, wood) Soft Fuzzy / Absorbant Surfaces (e.g., cloth, foam) Hard Smooth Surfaces (e.g., glass, new polycarbonate) Reflect sound in all directions High probability that the sensor will detect the object Moderate to high probability that the sound from the ultrasonic will be absorbed by the material Absorption means that the sensor will not see the object, and will give a false “all clear” reading Reflect sound incident to the surface High probability that the sensor will NOT see the object, unless the robot is directly facing the surface High probability that the sensor will give a false reading of an object it sees in the incident reflection! Sensors MRA EdDay 2017 10/28/2017
17
Good 1D Sensors Generic Ultrasonic HC-SR04 + Cheap (<$2.50 ea)
- Quality varies widely - Easily overwhelmed in the FRC environment: your program will have to deal with a lot of false or error prone data - Mounting Challenges Sharp GP2Y0A02YK0F / Sharp GP2Y0A41SK0F $10-$15 + Easy Analog Interface + Multiple versions available depending on distance needs My experience shows that the ones looking like the picture work the best out of the cheap variety. LIDAR Lite - Expensive ($150) + Long Range (20+ meters) – can cover an entire FRC field Maxbotics Ultrasonics - Expensive ($30-$50) + Much more reliable and known quality than generic ultrasonics + Wide variety of models to choose from Ultrasonic Cheap: Sharp IR: Lidar Lite: Ultrasonic Maxboxitocs: Sensors MRA EdDay 2017 10/28/2017
18
Where does 1D distance play?
Simple ranging tasks How far away is that boiler? Hint: IR distance sensors love those retroreflective target tapes! How far am I away from that wall? Hint: Remember your angles of reflection – FRC walls are often unfriendly to IR and ultrasonics, unless they are full of rough angles (e.g., scratched up polycarbonate, diamond plate aluminum) Sensors MRA EdDay 2017 10/28/2017
19
“2D” Distance Sensors Reports multiple distances at their corresponding angles Many types exist! Manually scanned 1D sensor (e.g., put a 1D distance sensor on a servo and code it up yourself) Self contained rotationally scanned No moving parts Do Don’t Balance Cost vs Capability Look at difficulty to connect to Rio and program (some sensors have built in WPILib libraries!) Make sure there are no obstructions in front of your sensor that will cause a false reading Go straight to the most expensive types without understanding why you are selecting them Assume that any sensor will work in the FRC field – remember what was said before about angles and reflections! Table look familiar? It should... We discussed it a mere 5 slides ago… Sensors MRA EdDay 2017 10/28/2017
20
A tale of three 2D sensors
Sweep RPLidar LedderTech $380 Should cover FRC distances (20+ meters) 1000sps Adjustable 2-10hz rotation speed Must buy two at once to meet FRC Price Limit qty 2) “Short” range (~5 meters) triangulation based ranging Very fast update rate (4000sps) Adjustable 5-15hz rotation speed $300 (Eval Kit) + No moving parts 16 distance segments over 45 degrees Sweep: RPLidar: LedderTech: Sensors MRA EdDay 2017 10/28/2017
21
Where does 2D distance play?
Simultaneous Localization and Mapping (SLAM) A more advanced topic than coverable in this presentation, but there are teams that have done SLAM in FRC – look for sample code! SLAM both builds a map of what the robot has seen and figures out where the robot is inside that map Because the field is always released as a 3D CAD file, you may be able to cheat and build a pre-gen map from that, and then use the LIDAR data purely for localization! Sensors MRA EdDay 2017 10/28/2017
22
“3D” Distance Sensors Reports multiple distances in their corresponding x and y directions (a 2D grid of distances!) Now we are getting a real ‘point cloud’! And we have to process all of it too Multiple types exist Passive visual (stereo comparison algorithms) Active IR (stereo comparison with an illuminated source) Many useful functions for 3D point clouds require Really advanced math (linear algebra) – look for libraries and code samples that do these functions already for you! Do Don’t Balance Cost vs Capability Look into what non-RoboRio processor you are putting on your robot to deal with this amount of data (e.g., Jetson TX1 or TX2) Have one or two people specialize in this sensor Try this in your Rookie year Try this with a small programming team Expect this complex of a sensor to work in six weeks – off season experience / summer project experience is strongly recommended Sensors MRA EdDay 2017 10/28/2017
23
A tale of ‘three’ 3D sensors
Kinect Intel Realsense Stereolabs Zed <$150 - Excessive amounts of cables - HUGE compared to newer offerings + Special mode eliminates facility lights R200 ($109, very limited end of life stock left) D435 ($180, hits market soon) Euclid ($399, built in processor) Incredibly small packages $449 (FRC discount under price limit available) Passive Stereo sensing - Requires GPU acceleration for reasonable performance (e.g., NVidia Jetson TX2) Realsense: All sensors above offer depth map and visible images, and all (except Euclid) require a USB 3.0 port! (You cannot Raspberry Pi these cameras) Sensors MRA EdDay 2017 10/28/2017
24
Where does 3D distance play?
Advanced SLAM Environment Recognition Object Manipulation Advanced obstacle avoidance 3D vision is very cool, but the vast majority of FRC challenges can be accomplished almost as well using simpler methods But don’t let this statement dissuade you from trying simply for the sheer cool factor! Sensors MRA EdDay 2017 10/28/2017
25
Speaking of Cameras… Lifecam HD-3000 OpenMV Jevois ~$26
The “standard” camera used in FRC for machine vision Great for Raspberry Pi, Odroid and other embedded processing Look into FRC’s GRIP tool 1280x720 $65 Complete camera + vision processor package Really small 640x480 / 216MHz Arm $50 - $60 Really small! 640x480 / 1.34GHz Arm Quadcore Still somewhat fiddly development environment HD-3000: Jevois: or OpenMV: or Pixy: Sensors MRA EdDay 2017 10/28/2017
26
Rotation / Angle Sensors
What angle is my (arm, shooter, manipulator) at? Rotation and Angle sensors can help with this question Many types of rotation or angle sensors Potentiometers Quadrature encoders Absolute magnetic encoders Accelerometers / IMUs (next topic…) Joint Angle Range Must be initialized from known position Can be used while robot in motion <~280* No Yes <360* >360 Maybe *It depends… Sensors MRA EdDay 2017 10/28/2017
27
Potentiometers A potentiometer is a variable resistor (turn it, and the resistance varies from ~0 to ~max) By hooking a potentiometer to a rotating arm, and measuring its resistance, you can figure out what angle the arm is at For FRC, stick with a potentiometer of the following specs: 10KΩ, Linear taper, 10% or better tolerance, panel mount, 0.25” shaft, solder lug terminals Most of these potentiometers will turn about 280° - Keep in mind any gear ratios you are adding between them and the arm! You can buy special potentiometers that can turn multiple revolutions $4 Short Shaft: Long Shaft: $10 Sensors MRA EdDay 2017 10/28/2017
28
Quadrature Encoders Quadrature Encoders count how far something has rotated Quadrature encoders are named by their A and B signals – there are four states these signals can be in, hence ‘quad’ If you start from a known position (typically at a limit switch), then you can measure how far something has rotated by maintaining a count of the ticks coming off the encoder If you don’t know where you started from, you can still measure the speed of rotation $24 – 2048ppr AMT103-V: E4T: $42 – 1440ppr Sensors MRA EdDay 2017 10/28/2017
29
Absolute Encoders Absolute Encoders provide you an absolute rotational angle measurement – you don’t need to start in a known position first This makes going to a specific angle really easy, as you don’t have to worry about counting Most magnetic absolute encoders operate over a full 360 degrees, which means you can go round and round and count revolutions in software $40 Both absolute and quadrature! Know both how fast an arm is rotating and where it is with one sensor! Sensors MRA EdDay 2017 10/28/2017
30
Accelerometers An accelerometer measures linear acceleration
IMUs (next slide) have accelerometers in them… But accelerometers do not measure rotation – so how can we measure angles with them? There is one acceleration always around us – Gravity! If we can measure where gravity is, then we know the angle of the item we are measuring! Requires an accelerometer with at least two axis, and some trigonometry However, you have to remember that robots can accelerate too, so you can only use this solution while moving if you can remove the robot’s overall acceleration No product pictures? Realistically, these days you buy a complete IMU, as they are cheap enough to replace accelerometers and offer more goodies Sensors MRA EdDay 2017 10/28/2017
31
IMUs Inertial Measurement Units (IMUs) allow you to measure how fast the robot is accelerating linearly, how fast it is rotating and where it is facing A typical IMU has nine or more sensors – 3 axis of linear acceleration, 3 axis of rotational velocity, and 3 axis of magnetic orientation (compass) Woah – that is a lot of different units! IMUs are a lot of math! (at least calculus level for useful features) – luckily, there are a lot of code samples to use Do Don’t Grab an IMU that has code examples published in your language Grab a Nav-X if you are unsure what to buy Try IMUs without a basic understanding of trigonometry Expect IMUs (that you can afford) to work over long time spans or distances (After a few minutes, drift will be bad enough to cause real errors) However, 2:30 is reasonable ;) Sensors MRA EdDay 2017 10/28/2017
32
IMUs navX MXP Adafruit BNO055 Breakout $99 De-facto FRC IMU
Fully supported in all three FRC programming languages with code examples Mounts to the Rio’s MXP connector $35 Does all nine-axis fusion internally, gives you the final results - No FRC library, so you are on your own to integrate NavX: Adafruit: Sensors MRA EdDay 2017 10/28/2017
33
Where is my robot? Quadrature encoders on wheel shafts are the ‘standard’ way to measure distance in FRC Keep in mind that wheels slip, and robots fly, so this is not a 100% foolproof method to measure actual travelled distance IMUs can be used over short periods of time to determine position by integrating acceleration and velocity, but will drift over time as well Advanced users can combine multiple sensors using fusion algorithms to really come up with a great sense of where the robot is Sensors MRA EdDay 2017 10/28/2017
34
Get Anything Parts Suppliers
Where to buy sensors? Robotshop.com Digikey.com Adafruit.com Mouser.com Sparkfun.com Newark.com Pololu.com Microcenter.com Amazon.com Andymark.com ctr-electronics.com Super Cool sites Get Anything Parts Suppliers Local! Last Resort Knows FRC Sensors MRA EdDay 2017 10/28/2017
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.